svm: Intercept and disallow MONITOR/MWAIT.
authorKeir Fraser <keir@xensource.com>
Fri, 9 Nov 2007 12:08:37 +0000 (12:08 +0000)
committerKeir Fraser <keir@xensource.com>
Fri, 9 Nov 2007 12:08:37 +0000 (12:08 +0000)
Signed-off-by: Keir Fraser <keir@xensource.com>
xen/arch/x86/hvm/svm/svm.c
xen/arch/x86/hvm/svm/vmcb.c

index 2e0c98a978a35d131f0d1ae2bb6703257dd63105..32d99c25fb3cfae92edff37c762432080c223a1f 100644 (file)
@@ -2280,13 +2280,14 @@ asmlinkage void svm_vmexit_handler(struct cpu_user_regs *regs)
         hvm_triple_fault();
         break;
 
+    case VMEXIT_MONITOR:
+    case VMEXIT_MWAIT:
     case VMEXIT_VMRUN:
     case VMEXIT_VMLOAD:
     case VMEXIT_VMSAVE:
     case VMEXIT_STGI:
     case VMEXIT_CLGI:
     case VMEXIT_SKINIT:
-        /* Report "Invalid opcode" on any VM-operation except VMMCALL */
         svm_inject_exception(v, TRAP_invalid_op, 0, 0);
         break;
 
index f7c59b604e9b76266d5730ed19a6c467d5798212..2332581ed639e5f903731308227d9b2bf7a506a9 100644 (file)
@@ -128,7 +128,8 @@ static int construct_vmcb(struct vcpu *v)
         GENERAL2_INTERCEPT_VMLOAD      | GENERAL2_INTERCEPT_VMSAVE      |
         GENERAL2_INTERCEPT_STGI        | GENERAL2_INTERCEPT_CLGI        |
         GENERAL2_INTERCEPT_SKINIT      | GENERAL2_INTERCEPT_RDTSCP      |
-        GENERAL2_INTERCEPT_WBINVD;
+        GENERAL2_INTERCEPT_WBINVD      | GENERAL2_INTERCEPT_MONITOR     |
+        GENERAL2_INTERCEPT_MWAIT;
 
     /* Intercept all debug-register writes. */
     vmcb->dr_intercepts = ~0u;